package router

import (
	"github.com/gin-gonic/gin"
	"loveserver/handler"
	"loveserver/middleware"
)

func loadWords(v1 *gin.RouterGroup){

	v1.Use()
	{
		v1.GET("/words/", handler.FetchAllWords)			// get /words => 获取所有誓言
		v1.GET("/words/:id", handler.FetchSingleWords)	// get /words/:id => 根据id获取誓言
		v1.POST("/words", middleware.JWTAuth(), handler.AddWords)				// post /words => 添加誓言
		v1.POST("/getuserlocation", handler.GetUserLocation)
		v1.POST("/setuserlocation", handler.SetUserLocation)
		v1.POST("/setswear", handler.SetSwear)
		v1.POST("/getswear", handler.Get)
	}

}